var httpUtils = require('../../utils/httpUtils.js');
var utils = require('../../utils/util.js');
var app = getApp();
Page({
  data: {
    title: '暂无标题',
    content: '暂无内容'
  },
  onLoad: function(option) {
    var adId = option.adId;
    var _this = this;
    var url = app.globalData.interfaceUrl + '/common.do?method=getByAdById';
    httpUtils.post(url, {
      id: adId
    }, function(res) {
      console.log(JSON.stringify(res));
      var respData = res.data.data;
      _this.setData({
        title: respData.adTitle,
        content: respData.adContent
      });
      console.log(JSON.stringify(res));
    }, function(res) {
      console.log(JSON.stringify(res));
    });
  }
})